{extend name="layouts/defatul" /}  <!--模板继承defatul，减少代码复用-->

{block name="title"}用户个人中心{/block}
{block name="content"}
<div class="row">
    <div class="offset-md-2 col-md-8 d-flex flex-column justify-content-center align-items-center">
        <img src="{$member->avatar}" alt="{$member->name}" class="img-thumbnail" width="200" />
        <h4 class="p-4 " style="color: deeppink">{$member->name}</h4>

    </div>

</div>

{include file="users/_switch_follower" /}


<div class="d-flex flex justify-content-center align-items-center pb-4 ">
    <div class="d-flex flex-column justify-content-center align-items-center px-4 border-end">
        <a href="{:url('user.followings',['id'=>$member['id']])}" class="text-success text-decoration-none">
            <?php echo $member->followings()->count(); ?>
        </a>
        <span class="text-secondary" style="font-size: 13px">关注</span>
    </div>

    <div class="d-flex flex-column justify-content-center align-items-center px-4 border-end">
        <a href="{:url('user.followers',['id'=>$member['id']])}" class="text-success text-decoration-none">
            <?php echo $member->followers()->count(); ?>
        </a>
        <span class="text-secondary" style="font-size: 13px">粉丝</span>
    </div>

    <div class="d-flex flex-column justify-content-center align-items-center px-4">
        <a href="#" class="text-success text-decoration-none">
            <?php echo $member->topics()->count(); ?>
        </a>
        <span class="text-secondary" style="font-size: 13px">博文</span>
    </div>
</div>

<div class="row">
    <div class=" col-md-8 offset-md-2 ">
        {if $count > 0 }
        <div class="card">
            <div class="card-header text-center h5">
                <i class="fa fa-list-ul text-success"  aria-hidden="true"></i>&nbsp;TA发的博文列表
            </div>
            <div class="card-body">

                <ul class="list-group list-group-flush">
                    {foreach $topics as $topic}
                    {include file="topics/_topic" /}
                    {/foreach}
                </ul>
                <div class="pages d-flex justify-content-end align-items-center">
                    {$topics|raw}
                    <span class="count">总条数:{$count}</span>
                </div>
                {else /}
                    <div class="alert alert-danger" role="alert" >
                        <i class="fa fa-exclamation-triangle"></i> 这家伙很懒，什么也没留下~
                    </div>
                {/if}
            </div>

        </div>
    </div>
</div>
{/block}

<!--个人中心页 -->